Skip to content

support export cached_dataset #4992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Jintao-Huang
Copy link
Collaborator

No description provided.

@Jintao-Huang Jintao-Huang changed the title support export bin_dataset support export cached_dataset Jul 28, 2025
@Jintao-Huang
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces functionality to export and use pre-processed, cached datasets, which is a valuable feature for accelerating development and training workflows. The implementation includes new arguments, an export script, and updates to the training pipeline to handle these cached datasets. The associated refactoring of argument handling and dataset preparation logic improves the overall code structure. The changes are well-implemented and consistent. I have one suggestion to improve code readability in the new ExportCachedDataset class.

args: args_class

def __init__(self, args: Union[List[str], ExportArguments, None] = None) -> None:
super(SwiftSft, self).__init__(args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of super(SwiftSft, self) bypasses the SwiftSft parent's __init__ to call SwiftPipeline.__init__. While functional, this is not idiomatic in Python 3 and can be confusing. For better readability, it's recommended to call the grandparent's __init__ explicitly. This makes the intent of skipping the direct parent's initializer clear. You'll need to add from swift.llm import SwiftPipeline to your imports.

Suggested change
super(SwiftSft, self).__init__(args)
from swift.llm import SwiftPipeline
SwiftPipeline.__init__(self, args)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant